package com.hmall.search.mq;

import com.hmall.search.service.ISearchService;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
public class ItemListener {
    @Autowired
    private ISearchService searchService;

    @RabbitListener(queues = "hotel.insert.queue")
    public void listenItemInsert(Long id){
        searchService.insert(id);
    }

    @RabbitListener(queues = "hotel.delete.queue")
    public void listenItemDelete(Long id){
        searchService.delete(id);
    }

}
